package org.jackysoft.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Type;
import org.jackysoft.entity.AbstractEntity;
import org.jackysoft.entity.Department;
import org.jackysoft.entity.User;
import org.jackysoft.util.MySqlSchema;
import org.joda.time.DateTime;

@Entity
@Table(schema=MySqlSchema.Businessbase)
@org.hibernate.annotations.Entity(dynamicUpdate = true, dynamicInsert = true)
public class Journal extends AbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 432036178415941687L;

	private byte[] data = new byte[0];
	private DateTime createDate = DateTime.now();
	private Department department;
	private User lastuser;

	public Journal() {

	}

	@Column(length=65535)
	public byte[] getData() {
		return data;
	}

	public void setData(byte[] data) {
		this.data = data;
	}

	
	@Type(type = "jodatime")
	public DateTime getCreateDate() {
		return createDate;
	}

	public void setCreateDate(DateTime createDate) {
		this.createDate = createDate;
	}

	
	@ManyToOne
	public User getLastuser() {
		return lastuser;
	}

	public void setLastuser(User lastuser) {
		this.lastuser = lastuser;
	}

	
	@ManyToOne
	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

}